<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>背景不停渐变</title>
		<style>
			* {
				margin: 0;
				padding: 0;
				font-size: 1rem;
			}
			body {
				display: flex;
				justify-content: center;
				align-items: center;
				height: 100vh;
				color: #fff;
				text-transform: uppercase;
				font-size: 3.2rem;
				background: linear-gradient(125deg, #2c3e50, #27ae60, #2980b9, #e74c3c, #8e44ad);
				background-size: 400%;
				animation: bgAn linear 20s infinite;
			}
			.box {
				position: relative;
				left: 0;
				top: 0;
				width: 30rem;
				height: 10rem;
				line-height: 10rem;
				text-align: center;
			}
			@keyframes bgAn {
				100% {
					background-position: 100% 50%;
				}
			}
		</style>
	</head>
	<body>
		<div class="box">background</div>
	</body>
</html>
